home *** CD-ROM | disk | FTP | other *** search
- Path: newsroom.hitc.com!usenet
- From: psand@eos.hitc.com (G. Patrick Sand)
- Newsgroups: comp.lang.c++
- Subject: Re: Tough FACTORIAL math problem...
- Date: 17 Feb 1996 20:20:09 GMT
- Organization: Hughes Aircraft (EOSDIS)
- Message-ID: <4g5d9p$f2n@newsroom.hitc.com>
- References: <4fr8be$ass@news.iconn.net> <31224679.6193@born.com> <4g00u6$gkk@sun001.spd.dsccc.com> <DMvKp5.2wL@undergrad.math.uwaterloo.ca> <4g2fdq$ibo@beach.and.nl>
- NNTP-Posting-Host: 155.157.118.56
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.99.3
-
-
- >Ok, party on ...
- >
- > 7! = 7x6! ~ 7x2 = 14 ~ 4
- > 8! = 8x7! ~ 8x4 = 32 ~ 2
- > 9! = 9x8! ~ 9x2 = 18 ~ 8
- > 10! = 10x9! ~10x8 = 80 ~ 8
- > 11! = 11x10! ~11x8 = 88 ~ 8
- > 12! = 12x11! ~12x8 = 96 ~ 6
- > 13! = 13x12! ~13x6 = 78 ~ 8
- > 14! = 14x13! ~14x8 =112 ~ 2
- > 15! = 15x14! ~15x2 = 30 ~ 3
- >
- >erm ... 15! happens to be equal to 130764368000 ...
- > ^
- > |
- > |
- > See? see? see?
- >
- >This technique does give the correct result up 'till a certain number ;-
- >)
- >
- >Jos aka jos@and.nl (the middle initial 'A' stands for 'silly')
- >
- >ps. No hard feelings, I fell into this trap open eyed yesterday
- > and I still feel silly to the core ... ;-)
- >--
- >Atnwgqkrl gy zit vgksr, ug qshiqwtzoeqs!
- >
-
- Yikes!!! Looks like I also forgot about "carry numbers"...I wonder if I
- used a 99x99 matrix instead of a 9x9...Nah...But he does bring up the
- fact that this problem has to deal with more than the least significant
- non-zero digit of the factorial value when computing the next one...I
- guess three digits will work for values up to 1,000....Gut feeling is
- that for factorials up through 10**N, you will need to keep the least
- significant N digits for the factorials up to that point...I might try
- this out at home...
-
- Nice job Jos...I pretty sure I need a vacation now, if I missed this
- one...
-
- Let's see... 1 and 1 is 2, 2 and 2 is four, .... and 15 * 12 is 180, not
- something ending in 30...
-
- --
- G. Patrick Sand
- psand@eos.hitc.com
- PatSand@aol.com
- (301) 925-0791
- "Travel Light But Right..."
- Microsoft Network is prohibited from redistributing
- this work in any form, in whole or in part. License
- to distribute this individual post is available to Microsoft
- for $999. Posting without permission constitutes an
- agreement to these terms...gps
-
-